<?php

namespace App\Http\Controllers\Edu;

use App\Models\EduZan;
use App\User;
use Illuminate\Http\Request;
use App\Http\Controllers\Controller;
use Spatie\Activitylog\Models\Activity;

class HomeController extends Controller
{
    public function index(){
        //这个控制器方法用来渲染网站首页,展示网站的动态信息
        //EduTopic模型对象引入了LogsActivity类,所以EduTopic模型的变动信息就会被存放到activity_log网站动态日志表中
        //可以通过Activity类的all()方法将网站的动态信息都获取到
        $activities = Activity::where('is_active',1)->paginate(3);
        return view('edu.home_index',compact('activities'));
    }
}
